package application;

import static implementations.Values.integerGraph;
import static implementations.Values.undirectedEdge;
import static implementations.Values.vertex;
import implementations.UndirectedIntegerGraph;
import interfaces.Edge;
import interfaces.Vertex;

public class GkaAufgabe2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Vertex<String> v1 = vertex("v1");
		Vertex<String> v2 = vertex("v2");
		Vertex<String> v3 = vertex("v3");
		Vertex<String> v4 = vertex("v4");
		
		Edge<Integer,String> e1 = undirectedEdge("e1",v1,v2, 10);
		Edge<Integer,String> e2 = undirectedEdge("e2",v1,v3, 12);
		Edge<Integer,String> e3 = undirectedEdge("e3",v1,v4, 1);
		Edge<Integer,String> e4 = undirectedEdge("e4",v4,v3, 2);
		Edge<Integer,String> e5 = undirectedEdge("e5",v3,v2, 4);
		Edge<Integer,String> e6 = undirectedEdge("e6",v4,v2, 11);
		
		UndirectedIntegerGraph<String> g1 = integerGraph(v1);
	
		
		g1.add(e1);
		g1.add(e2);
		g1.add(e3);
		g1.add(e4);
		g1.add(e5);
		g1.add(e6);
		
		System.out.println("Graph:\n");
		System.out.println(g1);
		System.out.println("--------------------");
		System.out.println("Floyd Algorithmus:\n");
		System.out.println(g1.floydAlgorithm(v1, v2));
		System.out.println("Laufzeit: " + g1.runtimeLastAlgorithm());
		System.out.println("Zugriffe: " + g1.lastNumberOfAccesses());
		System.out.println("--------------------");
		System.out.println("Dijkstra Algorithmus:");
		System.out.println(g1.dijkstraAlgorithm(v1, v2));
		System.out.println("Laufzeit: " + g1.runtimeLastAlgorithm());
		System.out.println("Zugriffe: " + g1.lastNumberOfAccesses());
		
	

	}

}
